﻿
using Microsoft.Extensions.DependencyInjection;

namespace zijian666.WebApi
{
    public partial class WebApiOptions
    {

        /// <summary>
        /// 启用跨域支持对所有请求
        /// </summary>
        public void EnableCors() => _services.AddCors(option => option.AddPolicy("cors", policy => policy.AllowAnyHeader().AllowAnyMethod().AllowAnyOrigin()));
    }
}
